/*
 *  SableJBDD, a Java Binary Decision Diagram package.
 *  Copyright (C) 2004  Feng Qian
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
//$Id: ExpandibleNodePool.java,v 1.4 2004/03/15 02:07:04 fqian Exp $
package SableJBDD.bdd.internal;
import SableJBDD.bdd.JBddNode;

/**
 * An expandible and reclaimable node pool dynamically expands phantom 
 * node queue for recycling all newly created nodes(vs pre-allocated nodes).
 * It can recycle all allocated nodes.
 *
 * @author Feng Qian
 */

public class ExpandibleNodePool extends ReclaimableNodePool{
  public ExpandibleNodePool (int size) {
    super(size);
  }

  protected synchronized void newNodeCreated(JBddNode node) {
    // always insert newly created node at the beginning of queue
    super.refs = new PhantomNode(node, super.refq, super.refs);
    super.phantomQueueSize ++;
  }
}
